<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    img{
        border: red solid 1px;
    }
</style>
<body>
<img id="img-captcha" src="javascript:void(0)" alt="captcha" />
<img id="img-slide" src="javascript:void(0)" alt="captcha" />
<div>
    <button id="btn-test">test</button>
</div>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
    window.addEventListener("load", ()=>{
        $.ajax("/my-captcha")
            .then(res=>{
                $("#img-captcha").attr("src", res.image);
                $("#img-slide").attr("src", res.slider);
            });
        $("#btn-test").on("click", e=>{
            $.ajax("/test")
                .then(res=>{
                    console.log(res)
                })
                .catch(e=>{
                    console.log(e)
                })
        })
    })
</script>
</html>
